package cn.hls.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
  *@fileName: Shipper.java
  *@package: cn.hls.entity
　*@Description: 托运方实体类
　*@author: yinghui.zhang
　*@email: uuhui@163.com
  *@date: 2016年6月10日
 *
 */
@Entity
@Table(name = "t_shipper")
@DynamicUpdate
@DynamicInsert
public class Shipper extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 5651909625261626688L;
	private Company company;// 托运企业
	private String bankAccount;// 开户银行
	private String accountName;// 开户户主名称
	private String accountNum;// 开户账号
	private String contractor;// 联系人
	private String contractorIdno;// 联系人身份证
	private String idnoImg;//联系人身份证正反面
	private String contractPhone;// 联系电话
	private String officePhone;//办公室电话
	private String address;// 托运地址
	private String status;// 状态 1-正常 2-暂停
	private String remark;//备注

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "company_id")
	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@Column(name = "bank_account", length = 32)
	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	@Column(name = "account_name", length = 32)
	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	@Column(name = "account_num", length = 32)
	public String getAccountNum() {
		return accountNum;
	}

	public void setAccountNum(String accountNum) {
		this.accountNum = accountNum;
	}

	@Column(name = "contractor", length = 16)
	public String getContractor() {
		return contractor;
	}

	public void setContractor(String contractor) {
		this.contractor = contractor;
	}

	@Column(name = "contractor_idno")
	public String getContractorIdno() {
		return contractorIdno;
	}

	public void setContractorIdno(String contractorIdno) {
		this.contractorIdno = contractorIdno;
	}

	@Column(name = "contract_phone", length = 16)
	public String getContractPhone() {
		return contractPhone;
	}

	public void setContractPhone(String contractPhone) {
		this.contractPhone = contractPhone;
	}
	
	@Column(name="office_phone",length=16)
	public String getOfficePhone() {
		return officePhone;
	}

	public void setOfficePhone(String officePhone) {
		this.officePhone = officePhone;
	}

	@Column(name = "address", length = 100)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "status", length = 1, columnDefinition = "char default 1")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name="idno_img")
	public String getIdnoImg() {
		return idnoImg;
	}

	public void setIdnoImg(String idnoImg) {
		this.idnoImg = idnoImg;
	}

	@JsonIgnore
	@Column(name="remark",length=100)
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
